home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / text_utl / vuestr / outline.bas < prev    next >
Encoding:
BASIC Source File  |  1995-01-07  |  1.2 KB  |  54 lines

  1.  
  2. Sub Outlines (FormName As Form)
  3.     
  4. Dim drkgray     As Long
  5. Dim fullwhite   As Long
  6. Dim i           As Integer
  7. Dim ctop        As Integer
  8. Dim cleft       As Integer
  9. Dim cright      As Integer
  10. Dim cbottom     As Integer
  11. Dim Offset      As Integer
  12.  
  13.     On Error Resume Next
  14.     
  15.     Dim cName As Control
  16.     Offset = 0
  17.  
  18.     FormName.Cls
  19.     
  20.     drkgray = RGB(128, 128, 128)
  21.     fullwhite = RGB(255, 255, 255)
  22.  
  23.     For i = 0 To (FormName.Controls.Count - 1)
  24.     
  25.     Set cName = FormName.Controls(i)
  26.  
  27.     If TypeOf cName Is Menu Then
  28.  
  29.         GoTo SkipThisControl
  30.         
  31.     End If
  32.         
  33.     
  34.     If (UCase(cName.Tag) = "OL") Then
  35.         
  36.         ctop = cName.Top - Screen.TwipsPerPixelY
  37.         cleft = cName.Left - Screen.TwipsPerPixelX
  38.         cright = cName.Left + cName.Width + (Screen.TwipsPerPixelX * Offset)
  39.         cbottom = cName.Top + cName.Height + (Screen.TwipsPerPixelY * Offset)
  40.         
  41.         FormName.Line (cleft, ctop)-(cright, ctop), drkgray
  42.         FormName.Line (cleft, ctop)-(cleft, cbottom), drkgray
  43.         FormName.Line (cleft, cbottom)-(cright, cbottom), fullwhite
  44.         FormName.Line (cright, ctop)-(cright, cbottom), fullwhite
  45.     
  46.     End If
  47.  
  48. SkipThisControl:
  49.     
  50.     Next i
  51.  
  52. End Sub
  53.  
  54.